$('form').submit(function(event){
    event.preventDefault();
    var pic = new FormData(this);
    $.ajax({
        url:'/upload',
        data:pic,
        method:'POST',
        contentType:false,
        processData:false,
        success:function (data) { 
            console.log(data);
            if(data.result == 1){
                location.href = './fabu.html';
            }else{
                alert(data.message);
            }
        }
    })
})
